import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children:[
      {
        path: '/element',
        name: 'element',
        component: () => import('../views/Element.vue')
      },
      {
        path: '/matLabel',
        name: 'matLabel',
        component: () => import('../views/matLabel.vue')
      }
    ]
  },
  
  
]

const router = new VueRouter({
  mode: 'history', // 默认是hash，兼容性更好   hisitory是IE10以上支持，
  base: process.env.BASE_URL,
  routes
})

export default router
